package designpattern.command;

/**
 * TODO:类描述
 *
 * @className: Client
 * @packageName: designpattern.command
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/21 20:05
 */
public class Client {
    public static void main(String[] args) {
        TV tv = new TV();

        TurnOnCommand onCommand = new TurnOnCommand(tv);
        TurnOffCommand offCommand = new TurnOffCommand(tv);
        ChangeChannelCommand changeChannelCommand = new ChangeChannelCommand(tv,2);

        Control control = new Control(onCommand,offCommand,changeChannelCommand);

        control.turnOn();
        control.turnOff();
        control.changeChannel();
    }
}
